﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

using ZhimeiSoft.Framework.Common.RefectUtils;
using ZhimeiSoft.CharmManager.Server.BLL.Interface;

namespace ZhimeiSoft.CharmManager.Server.Factory
{
    public class BaseBLLFactory
    {

        private static readonly string path = System.Configuration.ConfigurationManager.AppSettings["BusinessBLLImpl"];

        private BaseBLLFactory()
        {

        }

        public static IEmployeeBLL CreateEmployeeBLL()
        {
            string className = path + ".EmployeeBLL";
            return (IEmployeeBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static ICustomerBLL CreateCustomerBLL()
        {
            string className = path + ".CustomerBLL";
            return (ICustomerBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IEmployeeVacationBLL CreateEmployeeVacationBLL(){
            string className = path + ".EmployeeVacationBLL";
            return (IEmployeeVacationBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static ISalonInfoBLL CreateSalonInfoBLL()
        {
            string className = path + ".SalonInfoBLL";
            return (ISalonInfoBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IScheduleBLL CreateScheuleBLL()
        {
            string className = path + ".ScheduleBLL";
            return (IScheduleBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IServiceItemBLL CreateServiceItemBLL()
        {
            string className = path + ".ServiceItemBLL";
            return (IServiceItemBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IServiceItemCategoryBLL CreateServiceItemCategoryBLL()
        {
            string className = path + ".ServiceItemCategoryBLL";
            return (IServiceItemCategoryBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IReservationBLL CreateReservationBLL()
        {
            string className = path + ".ReservationBLL";
            return (IReservationBLL)Assembly.Load(path).CreateInstance(className);
        }
        public static IToDoListBLL CreateToDoListBLL()
        {
            string className = path + ".ToDoListBLL";
            return (IToDoListBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IServiceItemDetailBLL CreateServiceItemDetailBLL()
        {
            string className = path + ".ServiceItemDetailBLL";
            return (IServiceItemDetailBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static ICustomerServiceItemBLL CreateCustomerServiceItemBLL()
        {
            string className = path + ".CustomerServiceItemBLL";
            return (ICustomerServiceItemBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static ICustomerServiceItemReservationTimeBLL CreateCustomerServiceItemReservationTimeBLL()
        {
            string className = path + ".CustomerServiceItemReservationTimeBLL";
            return (ICustomerServiceItemReservationTimeBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static ICustomerReturnVisitBLL CreateCustomerReturnVisitBLL()
        {
            string className = path + ".CustomerReturnVisitBLL";
            return (ICustomerReturnVisitBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IPayTypeBLL CreatePayTypeBLL()
        {
            string className = path + ".PayTypeBLL";
            return (IPayTypeBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static ICustomerPaymentBLL CreateCustomerPaymentBLL()
        {
            string className = path + ".CustomerPaymentBLL";
            return (ICustomerPaymentBLL)Assembly.Load(path).CreateInstance(className);
        }
    }
}
